<!DOCTYPE html>
<html>
<head>
	<title>会员管理</title>
	<include file='public/head'>
	<style>
		.layui-legend-size{font-size:14px !important;}
		.layui-nopadding{padding:0 !important;}
		.layui-overflow{overflow:auto;}
		.layui-nomargin{margin: 0 !important;}
		.layui-bottom{border-bottom:1px solid rgb(226, 226, 226);}
		.layui-input{height:30px !important; }
		.layui-form-search-item .layui-inline{margin-bottom: 5px;} 
		.layui-form-search-item label{margin-left: 15px;}
		.layui-table-page {padding: 7px 0px 0px;}
		.layui-field-padding{border-width: 1px;padding:0 0 5px 10px;}
	</style>		
</head>
<body>
<!-- layui-tab开始 -->
<div class="layui-tab " lay-filter="demo-tab">
	<!-- 顶部导航菜单开始 -->
	<div class="layui-tab-nav" >
        <ul class="layui-tab-title">
			{:getNav('member','admin_index/index')};
		</ul>
	</div>
	<div style="padding:10px;">

<div class="layui-btn-group">
<button type="button" class="layui-btn ">全部商品(50)</button>
<button type="button" class="layui-btn layui-btn-primary">普通商品(40)</button>
<button type="button" class="layui-btn layui-btn-primary">积分商品(10)</button>
</div>

</div>	
	<!-- 顶部导航菜单结束 -->
	<!-- 搜索栏开始 -->
	<fieldset class="layui-elem-field layui-field-title layui-field-padding">
		<legend class="layui-legend-size">搜索</legend>
		<form class="layui-form table-bar" action="{:cmf_plugin_url('Member://admin_index/index')}" lay-filter="form-bar" method="post">
			<div class="layui-form-search-item">

<div class="layui-inline">
	<div class="layui-input-inline" style="width:100px;">
	    <select name="city" >
			<option value="">用户姓名</option>
			<option value="1" >手机号</option>
			<option value="2" >昵称</option>
		</select> 
	</div>
	<div class="layui-input-inline">
		<input type="text" name="title" required lay-verify="required" placeholder="请输入关键字..." autocomplete="off" class="layui-input">  
	</div>
</div>

<div class="layui-inline">
	<div class="layui-input-inline" style="width:100px;">
	    <select name="city" >
			<option value="">状态</option>
			<option value="1" >开启</option>
			<option value="2" >关闭</option>
		</select> 
	</div>
</div>



			    
<label>时间</label>
<div class="layui-inline">
	<div class="layui-input-inline">
		<input type="text" name="search[start_time]" class="layui-input" id="test1" style="width: 100px;">
	</div>
	-
	<div class="layui-input-inline">
		<input type="text"  name="search[end_time]" class="layui-input" id="test2" style="width: 100px;">
	</div>
</div>

<label>单选</label>
<div class="layui-inline">
	<div class="layui-input-inline">
		<input type="checkbox" name="zzz" lay-skin="switch" lay-text="开启|关闭">
	</div>
</div>

<label>复选</label>
<div class="layui-inline">
	<div class="layui-input-inline">
		<input type="checkbox" name="" title="写作" checked>
	</div>
</div>


 <div class="layui-inline">
	<div class="layui-input-inline">
		<button type="submit" class="layui-btn layui-btn-sm layui-btn-primary " style="font-weight:800;" lay-submit="" lay-filter="demo2"><i class="layui-icon ">&#xe615;</i>搜索</button>
	</div>
</div>
		
	
				
			</div>
			
			
		</form>
	</fieldset>

	
	<!-- 搜索栏结束 -->
	<!-- 表格内容开始 -->
	<div class="layui-card">
		<div class="layui-card-header layui-bg-gray layui-bottom">
			<a href="javascript:;" class="layui-btn layui-btn-xs layui-btn-danger batch-delete" ><i class="layui-icon">&#xe640;</i>批量删除</a>
			<a href="javascript:;" class="layui-btn layui-btn-xs add-btn" ><i class="layui-icon">&#xe654;</i>添加</a>
		</div>
		<div class="layui-card-body layui-nopadding " >
			<table  class="layui-table layui-nomargin" >
				<!-- 表格头 -->
				<thead>
					<tr>
						<th width='20px'>
							<input type='checkbox' id='check-box-all' class='layui-form-checkbox'>
						</th>
						<th>字段</th>
						<th>字段</th>
						<th>字段</th>
						<th>字段</th>
						<th>字段</th>
						<th width="200">操作</th>
					</tr>
				</thead>
				<tbody>
				    <tr>
				        <td><input type='checkbox' id='check-box' class='layui-form-checkbox'></td>
				        <td style="text-align:left;">内容</td>
				        <td style="text-align:left;">内容</td>
				        <td style="text-align:left;">内容</td>
				        <td style="text-align:left;">内容</td>
				        <td style="text-align:left;"><form class="layui-form" >
				            <div class="layui-input-inline">
		<input type="checkbox" name="zzz" lay-skin="switch" lay-text="开启|关闭"></form>
	</div>
				        <td style="text-align:left;">
				            <div class="layui-btn-group">
  <button type="button" class="layui-btn layui-btn-primary layui-btn-xs" title="详情">
    <i class="layui-icon">&#xe602;</i>
  </button>
  <button type="button" class="layui-btn layui-btn-primary layui-btn-xs" title="编辑">
    <i class="layui-icon">&#xe642;</i>
  </button>
  <button type="button" class="layui-btn layui-btn-primary layui-btn-xs" title="确认/通过">
    <i class="layui-icon">&#xe605;</i>
  </button>
  <button type="button" class="layui-btn layui-btn-primary layui-btn-xs" title="取消/不通过">
    <i class="layui-icon">&#x1006;</i>
  </button>
  <button type="button" class="layui-btn layui-btn-primary layui-btn-xs" title="删除/移除">
    <i class="layui-icon">&#xe640;</i>
  </button>
</div>
				        </td>
				    </tr>
				</tbody>
				<!-- 表格头 -->
				<!-- 表格内容输出 -->

				<!-- 表格内容输出结束 -->
			</table>
<div id="demo7"></div>
		</div>
	</div>
	<!-- 表格内容开始 -->
	
</div>
	<include file='public/scripts'>
<script type="text/javascript">

  var laypage = layui.laypage
  ,layer = layui.layer;
  
  //总页数低于页码总数
  laypage.render({
    elem: 'demo0'
    ,count: 50 //数据总数
  });
  
 //完整功能
  laypage.render({
    elem: 'demo7'
    ,count: 100
    ,layout: ['count', 'prev', 'page', 'next', 'limit', 'refresh', 'skip']
    ,jump: function(obj){
      console.log(obj)
    }
  });

	//日期选择器	   
	laydate = layui.laydate;
	laydate.render({
		elem: '#test1' //指定元素
	});
	laydate.render({
		elem: '#test2' //指定元素
	});

	//全选/取消
	$('#check-box-all').on('click',function(){
		$('.check-box').prop('checked',$('#check-box-all').prop('checked'));
	});
	//详情
	$('.detail-btn').on('click',function(){
		let id = $(this).data('id');
		let url = "{:cmf_plugin_url('Member://admin_index/detailPage')}?id="+id;
		layer.open({
			type:2
			,title:"详情"
			,closeBtn:false
			,area:['800px','600px']
			,shade:0.8
			,id:'LAY_article'
			,btn:['确定']
			,btnAlign:'c'
			,content:url
			,moveType:1
		});
	})
	//添加表单
	$('.add-btn').on('click',function(){
		// console.log(111);
		let url = "{:cmf_plugin_url('Member://admin_index/addPage')}";
		layer.open({
			type: 2//基本层类型  0（信息框，默认）1（页面层）2（iframe层）3（加载层）4（tips层）
			,title: '添加'//层的标题
			,shadeClose: true//是否点击遮罩关闭
			,shade: 0.8//遮罩
			,area: ['800px', '600px']//宽高
			,btn:['提交','关闭']//弹框按钮
			,fixed:false//固定
			,content: url //iframe的url
			,yes:function(index, layero){
				//调用子页面方法
				// parentInfo = window["layui-layer-iframe" + index].callbackdata(index);
				var iframeWin = window[layero.find('iframe')[0]['name']]; //得到iframe页的窗口对象，执行iframe页的方法：
				iframeWin.tijiao();
			}
			,btn2:function(index, layero){
			}
		});
	});	
	//编辑页面
	$('.update-btn').on('click',function(){
		let id = $(this).data('id');
		let url = "{:cmf_plugin_url('Member://admin_index/editPage')}?id="+id;
		layer.open({
			type: 2//基本层类型  0（信息框，默认）1（页面层）2（iframe层）3（加载层）4（tips层）
			,title: '修改'//层的标题
			,shadeClose: true//是否点击遮罩关闭
			,shade: 0.8//遮罩
			,area: ['1000px', '600px']//宽高
			,btn:['提交','关闭']//弹框按钮
			,fixed:false//固定
			,content: url //iframe的url
			,yes:function(index, layero){
				//调用子页面方法
				// parentInfo = window["layui-layer-iframe" + index].callbackdata(index);
				var iframeWin = window[layero.find('iframe')[0]['name']]; //得到iframe页的窗口对象，执行iframe页的方法：
				iframeWin.tijiao();
			}
			,btn2:function(index, layero){
			}
		});
	});	
	//删除
	$('.delete-btn').on('click',function(){
		var  text = "确定要删除吗？";
		let id = $(this).data('id');
		let url = "{:cmf_plugin_url('Member://admin_index/delete')}";

		layer.confirm(text, {icon: 3, title:'提示', btn: ['确定','取消']}, function(index,layero){
	        $.ajax({
	            url:url,
	            data:{id:id},
	            success:function(data){
					if (data.code == 1) {
						layer.msg(data.msg,{icon:1,time:1500},function(){
							parent.layer.closeAll();
							parent.location.reload(); 
						});
					} else {
						layer.msg(data.msg,{icon:2,time:1500});
					}
	            },
	            error:function(){
	                layer.msg('系统错误',{icon:2,time:1500});
	            }
	        })
	    },function(index){
	        // alert('取消');
	    });		
	});
</script>
</body>
</html>